const {createServer}=require("http")
    io=require("socket.io")
module.exports=(app)=>{
    const server=createServer(app)
    const sc=io(server)
    
    sc.on("connection",res=>{
        console.log('有人链接');
    })
    server.listen(3000, () => {
        console.log('服务器开始');
    })
}   

// import { createServer } from "http";
// import { Server } from "socket.io";
// const httpServer = createServer();
// const io = new Server(httpServer, {
//   // options
// });

// io.on("connection", (socket) => {
//   // ...
// });

// httpServer.listen(3000);